
const angleToSin = (angle) => Math.sin(Math.PI / 180 * angle)

const computeAngleCAD = () => {
    const ACB = 20 + 50
    const ABC = 30 + 40
    const BAC = 180 - ACB - ABC
    const BDC = 180 - 40 - 20
    const CBD = 40

    const AB = 1
    const AC = (AB / angleToSin(ACB)) * angleToSin(ABC)
    const BC = (AB / angleToSin(ACB)) * angleToSin(BAC)
    const CD = (BC / angleToSin(BDC)) * angleToSin(CBD)

    for (let i = 1; i < BAC; i++) {
        const CAD = i
        const ADC = 180 - 50 - CAD

        const CAD_to_CD = (AC / angleToSin(ADC)) * angleToSin(CAD)

        if (CAD_to_CD.toFixed(2) == CD.toFixed(2)) {
            // console.log(i)
            // console.log(ADC_to_CD.toFixed(2), '  ',CD.toFixed(2))
            return CAD
        }
    }
}

console.log('CAD 角度：', computeAngleCAD())